#include <stdio.h>

int main() {
    int data1, data2;
    char op;
    double result;
    
    printf("请输入表达式: ");
    scanf("%d %c %d", &data1, &op, &data2);
    
    switch(op) {
        case '+':
            result = data1 + data2;
            printf("%d %c %d = %.2f\n", data1, op, data2, result);
            break;
        case '-':
            result = data1 - data2;
            printf("%d %c %d = %.2f\n", data1, op, data2, result);
            break;
        case '*':
            result = data1 * data2;
            printf("%d %c %d = %.2f\n", data1, op, data2, result);
            break;
        case '/':
            if (data2 != 0) {
                result = (double)data1 / data2;
                printf("%d %c %d = %.2f\n", data1, op, data2, result);
            } else {
                printf("错误：除数不能为零。\n");
            }
            break;
        default:
            printf("错误：不支持的运算符 '%c'。\n", op);
            break;
    }
    
    return 0;
}
